<script setup lang="ts">
import {computed, defineAsyncComponent} from 'vue';

const props = defineProps({
  iconNode: {
    type: String,
    required: true,
  },
  color: {
    type: String,
    default: '',
  },
});

const iconComponent = computed(() => {
  return defineAsyncComponent(() => import(`@/assets/icons/${props.iconNode}.svg`));
});
const iconColorClass = computed(() => props.color);
</script>

<template>
  <component :is="iconComponent" :class="['w-5 h-5', iconColorClass]"/>
</template>

<style scoped>

</style>